<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateAppCrashMain extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('app_crash_main', function (Blueprint $table) {
            $table->id();

            $table->string("eventType", 36)->default("")->comment("事件类型");
            $table->bigInteger("timestamp")->default(0)->comment("timestamp");
            $table->unsignedTinyInteger("isEncrypt")->default(0)->comment("isEncrypt");
            $table->string("signature")->default("")->comment("signature");
            $table->unsignedInteger("appId")->default(0)->comment("appId");
            $table->unsignedTinyInteger("platformId")->default(0)->comment("platformId - 平台");
            $table->string("appName")->default("")->comment("appName - app名称");
            $table->string("date", 8)->default("")->comment("date");
            $table->string("appUrl")->default("")->comment("appUrl");

            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');

            $table->collation = 'utf8mb4_general_ci';
            $table->comment   = 'app crash主表';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('app_crash_main');
    }
}
